{% extends 'base/base.html' %}
{% load static %}
{% block title %}
    购物车
{% endblock %}
{% block extcss %}

{#    <link href="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">#}
{#    <link rel="stylesheet" href="{% static 'base/css/reset.css' %}">#}
    <link rel="stylesheet" href="{% static 'cart/css/carts.css' %}"/>

{% endblock %}

{% block extjs %}
    <script src="{% static 'cart/js/cart.js' %}"></script>
{#    <script src="{% static 'base/js/jquery.cookie.js' %}"></script>#}
{#    <script src="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>#}
{% endblock %}
{% block content %}
    <!--页面主体  开始-->
    <div class="main_sh_wp" id="main_sh_wp">
        <div class="sh_wp_content">
            <div class="swc_top">
                <span>您当前的位置：</span>
                <a href="../index/index.html">首页</a>
                > 购物车
            </div>
            <!--购物车  无商品    开始-->
            <div class="no_shp" style="display: none;">
                <div class="cont">
                    <div class="lshp"></div>
                    <div class="rshp">
                        <span class="tit">您的购物车暂时是空的，您可以：</span>
                        <span >您还没有登录，可能导致购物车为空，请 <a href="{% url 'bbf:login' %}" class="no_login"> 马上登录</a></span>
                        <span>去<a href="{% url 'bbf:index' %}"> 首页 </a> 随便逛逛</span>
                    </div>
                </div>

            </div>
            <!--购物车  无商品    结束-->

            <!--购物车  添加商品    开始 -->
            <div class="shop_cart" id="shop_cart" style="display: block;">
                <!--购物导向图   开始-->
                <div class="m_pro m_cart">
                    <span class="p1"></span>
                    <span class="p2"></span>
                    <span class="p3"></span>
                </div>
                <!--购物导向图   开始-->

                <!--列表   开始-->
                <table width="1190" border="0" cellspacing="0" cellpadding="0" align="center" class="cart_t">
                    <tr>
                        <th style="text-align:left;" width="20"></th>
                        <th width="300" class="pad">商品</th>
                        <th width="300">会员价(元)</th>
                        <th width="300">数量</th>

                    </tr>

                </table>
                <!--列表   结束-->

                <!--加入的购物列表    开始 -->
                <div class="shop_content cart">
                    {% for cart in carts %}
{#                    <table width="1188" border="0" cellspacing="0" cellpadding="0" align="center" class="cart_list">#}
                    <table class="cart_list">
                        <tr>
                            <td style="text-align: left; padding-left: 10px;" width="20" valign="top">

{#                                <input type="checkbox" checked name="checkbox" />#}
                                <div class="confirm-wrapper" data-cardid="{{ cart.id }}">
                                    {% if cart.isselect %}
{#                                      <span class="glyphicon glyphicon-ok"></span>#}
                                        <input type="checkbox" checked name="checkbox" class="glyphicon glyphicon-ok">
                                    {% else %}
{#                                        <span class="no"></span>#}
                                        <input type="checkbox" name="checkbox" class="no">
                                    {% endif %}
                                </div>
                            </td>

                            <td width="200">
                                <div class="b_pord">
                                    <p class="pic img">
                                        <a href="{% url 'bbf:product_details' cart.goods.id %}">
                                            <img style="width: 60px" src="{% static cart.goods.productimg %}"/>
{#                                            <img src="{% static 'product_detail/img/jinge_small1.jpg' %}"/>#}
                                        </a>
                                    </p>
                                    <p class="pord_n name">
                                        <a href="{% url 'bbf:product_details' cart.goods.id %}"
                                           target="_blank">{{ cart.goods.productlongname }}</a>
                                    </p>

                                </div>
                            </td>
                            <td width="600" class="content-wrapper">
                                <div class="b_price">
                                    <p class="m_price">
                                        市场价：
                                        <del>{{ cart.goods.marketprice }}</del>
                                    </p>
                                    <p class="s_price" data-price="{{ cart.goods.price }}">
                                        会员价：<span class="price">{{ cart.goods.price }}</span>
                                    </p>
                                </div>
                            </td>

                            <td width="300" class="content-wrapper">
                                <div class="mo_num bt-wrapper">
                                    <span class="glyphicon rec" data-goodsid="{{ cart.goods.id }}"></span>
                                    <b class="num" data-number="{{ cart.number }}">
                                    {{ cart.number }}
                                    </b>
                                    <span class="glyphicon add" data-goodsid = '{{ cart.goods.id }}'></span>
                                </div>

                                <span id="testKucun" class="cart_storage_tips">库存{{ cart.goods.storenums }}件</span>
                            </td>

                        </tr>
                    </table>

                    <!--购物车列表 end-->
                    {% endfor %}

                </div>

                <!--结算    star-->
                <div class="b_total bill">
                    <div class="total_choose bill-left">
{#                        <input type="checkbox" name="checkAll" checked="checked"/><label>全选</label>#}

                        <div class="all" data-all="{{ isall | lower }}">
                        {% if isall %}
                            <input type="checkbox" name="checkAll" checked class="glyphicon glyphicon-ok"><label></label>
{#                            <span class="glyphicon glyphicon-ok"></span>#}
                        {% else %}
                            <input type="checkbox" name="checkAll"  class="no"><label></label>
{#                            <span class="no"></span>#}
                        {% endif %}
                        <b>全选</b>
                        </div>
                    </div>




                    <p class="total">商品原总价（不含运费）：<span class="t_price" id="allTotal">￥<span class="amount"></span></span></p>
                    <a href="{% url 'bbf:generateorder' %}" class="buy_btn order">去结算</a>
                </div>
                <!--结算    end-->
            </div>
            <!--购物车  添加商品    结束 -->
        </div>
    </div>
    <!--页面主体  结束-->

{% endblock %}